#!/bin/bash
clear
if [[ "$EUID" -ne 0 ]]; then
  echo -e "\033[1;31m Anda tiada kebenaran untuk menjalankan skrip ini! \033[0m"
  exit 1
fi

TEXT='\033[30;107;2m'
GREEN='\033[92m'
YELLOW='\033[93m'
ERROR='\033[97;41m'
RESET='\033[0m'

clear
echo
echo -e "${TEXT} ========================================================== ${RESET}"
echo -e "${TEXT} VLESS - SENARAI AKAUN                                      ${RESET}"
echo -e "${TEXT} ---------------------------------------------------------- ${RESET}"
echo
echo -e "${TEXT} Nama pengguna | Tarikh luput ${RESET}"
while read file; do
  clientName=$(echo $file | awk '{print $1}')
  clientExpDate=$(echo $file | awk '{print $4}')
  printf "%-17s %14s\n" "$clientName" "$clientExpDate"
done </usr/local/etc/v2ray/clients/.accounts
totalClient=$(wc -l /usr/local/etc/v2ray/clients/.accounts | awk '{print $1}')
totalClient=$(cat /usr/local/etc/v2ray/clients/.accounts | wc -l)

echo -e "${YELLOW} Jumlah akaun:${RESET} ${GREEN}$totalClient${RESET}"
echo
echo -e "${TEXT} ---------------------------------------------------------- ${RESET}"
echo -e "${TEXT} Dicipta oleh Doctype, Dikuasakan oleh Cybertize.           ${RESET}"
echo -e "${TEXT} ========================================================== ${RESET}"
echo
